/* 1. 变量与基础色彩体系 */
:root {
    --primary: #6366f1;
    --primary-light: #a5b4fc;
    --secondary: #22d3ee;
    --accent: #f59e42;
    --bg: #f0f4ff;
    --bg-card: #fff;
    --bg-panel: #f1f5f9;
    --border: #e0e7ff;
    --shadow: 0 8px 32px #6366f122;
    --radius: 18px;
    --radius-card: 20px;
    --radius-btn: 10px;
    --transition: 0.18s cubic-bezier(.4, 0, .2, 1);
}

body {
    background: linear-gradient(120deg, var(--bg) 0%, var(--border) 100%);
    min-height: 100vh;
    margin: 0;
    font-family: 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
    color: #222;
}

.container {
    max-width: 1400px;
    min-width: 1200px;
    margin: 32px auto 0 auto;
    background: var(--bg-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    padding: 32px 32px 32px 32px;
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* 2. Header与导航 */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.main-header h1 {
    font-size: 2.3rem;
    color: var(--primary);
    margin: 0;
    font-weight: 700;
    letter-spacing: 1px;
}

.main-nav {
    display: flex;
    gap: 18px;
    align-items: center;
}

.main-nav select {
    padding: 8px 18px;
    border-radius: var(--radius-btn);
    border: 1.5px solid var(--border);
    font-size: 1.08rem;
    background: #fff;
    transition: border var(--transition);
}

.main-nav select:focus {
    border-color: var(--primary);
}

.main-nav button {
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-btn);
    padding: 10px 26px;
    font-size: 1.05rem;
    cursor: pointer;
    font-weight: 500;
    box-shadow: 0 2px 8px #6366f133;
    transition: box-shadow var(--transition), background var(--transition);
}

.main-nav button#shop-btn {
    background: linear-gradient(90deg, var(--accent) 0%, #fbbf24 100%);
}

.main-nav button:hover {
    box-shadow: 0 4px 16px #6366f155;
    filter: brightness(1.08);
}

/* 3. 主体布局 */
.main-layout {
    display: flex;
    flex-direction: row;
    gap: 28px;
    align-items: flex-start;
    width: 100%;
    min-height: 600px;
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
    flex: 0 0 270px;
}

.left-panel {
    margin-right: 0;
}

.right-panel {
    margin-left: 0;
}

.center-panel {
    flex: 1 1 0%;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 4. 卡片通用样式 */
.card {
    background: var(--bg-panel);
    border-radius: var(--radius-card);
    box-shadow: 0 2px 12px #6366f122;
    padding: 26px 22px 22px 22px;
    margin-bottom: 0;
    border: 1.5px solid var(--border);
    transition: box-shadow var(--transition), border var(--transition);
}

.card h2 {
    margin-top: 0;
    font-size: 1.25rem;
    color: var(--secondary);
    font-weight: 600;
    margin-bottom: 18px;
}

/* 5. 背包、物品、装备、技能、状态区块 */
.bag-card,
.env-card,
.equip-card,
.skills-card,
.status-card,
.monster-info-card {
    min-height: 180px;
}

.bag-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.bag-title {
    font-size: 1.15rem;
    color: var(--primary);
    font-weight: 600;
}

.bag-pagination {
    display: flex;
    gap: 8px;
    align-items: center;
}

.bag-pagination button {
    background: var(--primary-light);
    color: #fff;
    border: none;
    border-radius: var(--radius-btn);
    padding: 4px 16px;
    font-size: 0.98rem;
    cursor: pointer;
    transition: background var(--transition);
}

.bag-pagination button:disabled {
    background: #e0e7ff;
    color: #aaa;
    cursor: not-allowed;
}

/* 6. 列表与卡片内容 */
.env-list,
.bag-list {
    min-height: 120px;
    background: #fff;
    border-radius: 10px;
    padding: 12px 0 8px 0;
    margin-bottom: 0;
    box-shadow: 0 1px 4px #6366f111;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: background var(--transition);
}

.env-list li,
.bag-list li {
    background: #f1f5f9;
    border-radius: 10px;
    box-shadow: 0 2px 8px #6366f122;
    padding: 16px 20px;
    min-width: 160px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: transform 0.1s, background var(--transition);
    font-size: 1.02em;
    cursor: grab;
    user-select: none;
}

.env-list li:hover,
.bag-list li:hover {
    transform: scale(1.04);
    background: var(--primary-light);
    z-index: 2;
    color: #fff;
}

.env-list li strong,
.bag-list li strong {
    color: var(--primary);
    font-size: 1.08em;
    margin-bottom: 2px;
    font-weight: 600;
}

.env-list .item-actions button,
.bag-list .item-actions button {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background var(--transition);
}

.env-list .item-actions button:hover,
.bag-list .item-actions button:hover {
    background: var(--secondary);
}

/* 7. 装备栏、属性面板 */
.equipments {
    display: flex;
    gap: 18px;
    margin-bottom: 12px;
}

.equip-slot {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px #6366f122;
    padding: 18px 14px;
    min-width: 90px;
    min-height: 70px;
    text-align: center;
    font-size: 1.01em;
    border: 1.5px solid var(--border);
    transition: border var(--transition), box-shadow var(--transition);
    cursor: pointer;
}

.equip-slot.empty {
    color: #bbb;
    background: #f8fafc;
    border-style: dashed;
}

.equip-slot strong {
    color: var(--primary);
    font-weight: 600;
}

.character-attributes {
    margin-top: 10px;
    background: #f9fafb;
    border-radius: 10px;
    box-shadow: 0 2px 8px #6366f122;
    padding: 14px 18px;
    font-size: 1.01em;
}

.character-attributes .attr-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 4px;
}

.character-attributes .attr-label {
    width: 48px;
    color: var(--primary);
    font-weight: 500;
}

.character-attributes .attr-base {
    color: #222;
}

.character-attributes .attr-bonus {
    color: var(--secondary);
}

.character-attributes .attr-final {
    color: var(--accent);
    font-weight: 600;
}

/* 8. 技能栏 */
.skills-box {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skill-item {
    background: linear-gradient(90deg, #f0f4ff 0%, #e0e7ff 100%);
    border-radius: 12px;
    box-shadow: 0 2px 8px #6366f122;
    padding: 18px 18px 14px 18px;
    margin-bottom: 0;
    border: 1.5px solid var(--primary-light);
    transition: box-shadow var(--transition), border var(--transition);
    position: relative;
}

.skill-item strong {
    color: var(--primary);
    font-size: 1.08em;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.skill-item .skill-type {
    color: var(--secondary);
    font-size: 0.98em;
    margin-left: 8px;
}

.skill-item .skill-desc {
    color: #555;
    font-size: 0.98em;
    margin-top: 6px;
}

.skill-item .use-skill-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-btn);
    padding: 6px 18px;
    font-size: 1em;
    cursor: pointer;
    margin-top: 10px;
    transition: background var(--transition);
}

.skill-item .use-skill-btn:disabled {
    background: #e0e7ff;
    color: #aaa;
    cursor: not-allowed;
}

.skill-item .use-skill-btn:hover:not(:disabled) {
    background: var(--secondary);
}

/* 9. 人物状态 */
.status-card .character-status {
    background: #f9fafb;
    border-radius: 10px;
    box-shadow: 0 2px 8px #6366f122;
    padding: 14px 18px;
    font-size: 1.01em;
}

.exp-bar {
    width: 100%;
    height: 12px;
    background: #e0e7ff;
    border-radius: 8px;
    margin-top: 8px;
    overflow: hidden;
}

.exp-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 8px;
    transition: width 0.3s;
}

/* 10. 弹窗与遮罩 */
.modal {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.32);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal[style*="display: flex"] {
    display: flex !important;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    padding: 32px 28px;
    min-width: 260px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 18px;
    top: 14px;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
    transition: color var(--transition);
}

.close:hover {
    color: var(--secondary);
}

/* 11. 响应式适配 */
@media (max-width: 1200px) {
    .container {
        min-width: 100vw;
        padding: 18px 2vw;
    }

    .main-layout {
        flex-direction: column;
        gap: 18px;
    }

    .side-panel,
    .center-panel {
        flex: 1 1 0%;
    }
}

@media (max-width: 800px) {
    .container {
        min-width: 100vw;
        padding: 8px 0;
    }

    .main-header {
        flex-direction: column;
        gap: 12px;
    }

    .main-layout {
        flex-direction: column;
        gap: 10px;
    }

    .side-panel,
    .center-panel {
        flex: 1 1 0%;
    }

    .card {
        padding: 12px 6px;
    }
}

/* 金币商城弹窗美化 */
#shop-modal .modal-content {
    min-width: 340px;
    max-width: 96vw;
    background: linear-gradient(120deg, #fff 60%, #fef6e4 100%);
    border-radius: 20px;
    box-shadow: 0 8px 32px #f59e4222, 0 2px 8px #6366f122;
    padding: 38px 36px 32px 36px;
    position: relative;
    border: 2px solid var(--accent);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
}

#shop-modal h2 {
    color: var(--accent);
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 18px;
    text-align: center;
    letter-spacing: 1px;
}

#shop-modal label {
    font-size: 1.08em;
    color: #b45309;
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

#shop-modal select,
#shop-modal input[type="number"] {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--accent);
    font-size: 1.08em;
    background: #fffbe9;
    margin-top: 6px;
    margin-bottom: 10px;
    transition: border var(--transition), box-shadow var(--transition);
    box-shadow: 0 1px 4px #f59e4211;
}

#shop-modal select:focus,
#shop-modal input[type="number"]:focus {
    border-color: var(--primary);
    outline: none;
}

#shop-buy-btn {
    background: linear-gradient(90deg, var(--accent) 0%, #fbbf24 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px 0;
    font-size: 1.18em;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 2px 8px #f59e4233;
    transition: background var(--transition), box-shadow var(--transition);
}

#shop-buy-btn:hover {
    background: linear-gradient(90deg, #fbbf24 0%, var(--accent) 100%);
    box-shadow: 0 4px 16px #f59e4255;
    filter: brightness(1.08);
}

#close-shop-modal.close {
    color: var(--accent);
    font-size: 1.7em;
    right: 18px;
    top: 14px;
    transition: color var(--transition);
}

#close-shop-modal.close:hover {
    color: #b45309;
}

#shop-modal .modal-content>div {
    margin-bottom: 10px;
}

@media (max-width: 600px) {
    #shop-modal .modal-content {
        min-width: 0;
        padding: 18px 6vw 18px 6vw;
    }

    #shop-modal h2 {
        font-size: 1.1rem;
    }

    #shop-buy-btn {
        font-size: 1em;
        padding: 10px 0;
    }
}